class SetData {
    constructor() {
        this.box = {}
        this.arr = new Array(
            "苏菜", "粤菜", "鲁菜", "川菜", "湘菜", "闽菜", "浙菜", "徽菜"
        )
        this.brr = [
            ["糖醋排骨", "狮子头", "太湖银鱼", "咕老肉"],
            ["烤乳猪", "什锦乌石参", "东江盐焗鸡"],
            ["灌汤包", "酱猪蹄", "香酥鸡"],
            ["回锅肉", "夫妻肺片", "麻婆豆腐", "宫保鸡丁", "鱼香肉丝"],
            [":东安子鸡", "臭豆腐", "红烧寒菌", "腊味合蒸"],
            ["鱼丸", "馄饨", "炸五香", "面线糊"],
            ["西湖醋鱼", "龙井虾仁", "宁波汤团"],
            ["火烘鱼", "蜜汁红芋", "清炖马蹄"]
        ]
    }
    init() {
        let crr = []
        let arr = this.arr
        let brr = this.brr
        for(let i=0; i<arr.length;i++ ){
            let ooj = {
                id:i,
                class:arr[i],
                list:[]
            }
          
            for(let j=0; j<brr[i].length; j++){
                let obj = {}
                obj.id = i+"-"+j //id
                obj.class = arr[i]//分类
                obj.name = brr[i][j]//菜名
                obj.num = Math.floor( Math.random()*55+13 )//库存
                obj.day = this.setString()
                ooj.list.push(obj)
               
            }
            crr.push(ooj)
        }
        return crr
    }

    setString() { //生成 时间
        var n = Math.floor(Math.random() * 2 + 2018)
        var y = Math.floor(Math.random() * 11 + 1)
        var r = Math.floor(Math.random() * 30)
        var s = Math.floor(Math.random() * 24)
        var f = Math.floor(Math.random() * 60)
        var m = Math.floor(Math.random() * 60)


        this.gettime = n + "-" + y + "-" + r + " " + s + ":" + f + ":" + m
        return this.gettime
      
    }
    randomName(min, max) { //生成随机数
        return Math.floor(Math.random() * (max - min) + min)
    }



}